package br.com.compraentrega.cbreader.visao;

import java.awt.FlowLayout;

/**
 *
 * @author Henrique Pontes
 * @version 0.1 08/17/2010
 */
public class GuiPrincipal extends javax.swing.JFrame {

    private GuiCadastrar guiCad = new GuiCadastrar();

    /** Cria o form GuiPrincipal, iniciando todos os componentes. */
    public GuiPrincipal() {

        setTitle("CB Reader");
        initComponents();
    }

    /**
     * Método gerado pelo netbeans para iniciar todos os componentes.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        menuPrincipal = new javax.swing.JMenuBar();
        menuArquivo = new javax.swing.JMenu();
        menuArquivoCadastrar = new javax.swing.JMenuItem();
        menuArquivoSincronizar = new javax.swing.JMenuItem();
        menuArquivoSair = new javax.swing.JMenuItem();
        menuAjuda = new javax.swing.JMenu();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        menuArquivo.setText("Arquivo");

        menuArquivoCadastrar.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_N, java.awt.event.InputEvent.CTRL_MASK));
        menuArquivoCadastrar.setText("Cadastrar");
        menuArquivoCadastrar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menuArquivoCadastrarActionPerformed(evt);
            }
        });
        menuArquivo.add(menuArquivoCadastrar);

        menuArquivoSincronizar.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.CTRL_MASK));
        menuArquivoSincronizar.setText("Sincronizar");
        menuArquivo.add(menuArquivoSincronizar);

        menuArquivoSair.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F4, java.awt.event.InputEvent.ALT_MASK));
        menuArquivoSair.setText("Sair");
        menuArquivoSair.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menuArquivoSairActionPerformed(evt);
            }
        });
        menuArquivo.add(menuArquivoSair);

        menuPrincipal.add(menuArquivo);

        menuAjuda.setText("Ajuda");
        menuPrincipal.add(menuAjuda);

        setJMenuBar(menuPrincipal);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 400, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 279, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    /*
     * Sai do aplicativo ao apertar o botão sair no menu "Arquivo".
     */
    private void menuArquivoSairActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuArquivoSairActionPerformed
        
        System.exit(0);

    }//GEN-LAST:event_menuArquivoSairActionPerformed

    private void menuArquivoCadastrarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuArquivoCadastrarActionPerformed

        setLayout(new FlowLayout());
        getContentPane().add(guiCad);
        pack();
       
    }//GEN-LAST:event_menuArquivoCadastrarActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JMenu menuAjuda;
    private javax.swing.JMenu menuArquivo;
    private javax.swing.JMenuItem menuArquivoCadastrar;
    private javax.swing.JMenuItem menuArquivoSair;
    private javax.swing.JMenuItem menuArquivoSincronizar;
    private javax.swing.JMenuBar menuPrincipal;
    // End of variables declaration//GEN-END:variables

}
